home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1987 July
/
Ahoy_Magazine_87-07_1987_Double_L_Side_A.d64
/
Exp. Power
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
472b
|
17 lines
0 rem << cd43-1 >>
1 rem ==================================
2 rem commodares problem #39-1 :
3 print"[147] [197]xponential [208]ower"
4 rem solution by
5 rem scott duncan, lon olson, and
6 rem ellis hormats
7 rem ==================================
10 print"evaluate n terms of series approximation for exp(x)"
20 input "input x,n";x,n
30 t=1 : e=1
40 for z=1 to n
50 t=t/z*x : e=e+t
60 next z
70 print "e ^";x;"is approximately "e
80 print " with an accuracy of" 100*(1-t*x/z);"%"